#ifndef QDATEINTERVALWIDGET_H
#define QDATEINTERVALWIDGET_H

#include <QWidget>
#include <QCalendarWidget>
#include <QPushButton>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDate>
#include <QPen>
#include <QBrush>

class QDateIntervalWidget : public QWidget
{
    Q_OBJECT

public:
    QDateIntervalWidget(QWidget *parent = nullptr);
    ~QDateIntervalWidget();

protected:
    QLabel *label;
    QCalendarWidget *calendar_start, *calendar_end;
    QPushButton *btn_confirm, *btn_cancel;
    QPushButton *btn_today, *btn_10day, *btn_month, *btn_year;
    QHBoxLayout *hLayout_BtnDate, *hLayout_calendar, *hLayout_OkCancel;
    QVBoxLayout *vMainLayout;

     QPen m_outlinePen;
     QBrush m_transparentBrush;

public:
    QDate date_start, date_end;
    QDate getStartDate();
    QDate getEndDate();
    void initSetting();

public slots:
    void on_btn_today_clicked();
    void on_btn_10day_clicked();
    void on_btn_month_clicked();
    void on_btn_year_clicked();
    void on_btn_confirm_clicked();
    void on_btn_cancel_clicked();
    void on_calendar_end_clicked();

protected:
    void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const;
};
#endif // QDATEINTERVALWIDGET_H
